package com.kit.data.kitopeso.device.data

import android.content.Context
import com.google.gson.Gson
import com.kit.data.kitopeso.base.BaseParams
import com.kit.data.kitopeso.device.util.NetworkUtil
import com.kit.data.kitopeso.device.util.gzipString

class WifiInfo(val context: Context) {

    fun fetch(): String? {
        return try {
            val data = hashMapOf<String, Any>().apply {
                put("currentWifi", NetworkUtil.getCurrentWifi(context))
                put("configuredWifi", "")
                put("wifiCount", "")
                put("version", BaseParams.getVersion(context))
            }
            Gson().toJson(data).trim().gzipString()

        } catch (e: Exception) {
            null
        }
    }
}